//
//  TestDateTime.m
//  xsd2cocoa
//
//  Created by Uwe Pachler on 03.01.14.
//
//

#import <SenTestingKit/SenTestingKit.h>

#import "DTTestDateTime.h"

#import "RTGlobalElement.h"

@interface TestReserved : SenTestCase {
	NSBundle* bundle;
}

@end


@implementation TestReserved


- (void)testDateTime
{
    NSURL *xml1URL = [bundle URLForResource:@"testReservedXml" withExtension:@"xml"];
    
    NSData* fileData = [NSData dataWithContentsOfURL: xml1URL];
    
    RTGlobalElement* rt = [RTGlobalElement fromGlobalElement: fileData];
    
    STAssertNotNil( rt, @"date read");
    STAssertEqualObjects(@"FOO_new", rt.elements.xml_new, @"xml_new");
    STAssertEqualObjects(@"FOO_try", rt.elements.xml_try, @"xml_try");
    STAssertEqualObjects(@"FOO_catch", rt.elements.xml_catch, @"xml_catch");
    STAssertEqualObjects(@"FOO_description", rt.elements.xml_description, @"xml_description");
	
    STAssertEqualObjects(@"FOO_new", rt.attributes.xml_new, @"xml_new");
    STAssertEqualObjects(@"FOO_try", rt.attributes.xml_try, @"xml_try");
    STAssertEqualObjects(@"FOO_catch", rt.attributes.xml_catch, @"xml_catch");
    STAssertEqualObjects(@"FOO_description", rt.attributes.xml_description, @"xml_description");

}

-(void)setUp {
    bundle = [[NSBundle bundleForClass:[TestReserved class]] retain];
}


@end
